using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// 燃烧buff，作用于玩家对象
/// </summary>
public class FireBuff : Buff
{
    public float damage;

    private float delay = 0;
    private float interval = 0;
    // Start is called before the first frame update
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {
        if (delay < duration/1000.0f)
        {
            if (interval > period / 1000.0f)
            {
                gameObject.GetComponentInParent<state>().health += damage;
                interval = 0;
            }
            interval += Time.deltaTime;


            delay += Time.deltaTime;
        }
        else
        {
            Destroy(this.gameObject);
        }
    }
}
